import { NgModule } from '@angular/core';
import { UEditorModule } from 'ngx-ueditor';



import { SharedModule } from '@shared/shared.module';
import { RouteRoutingModule } from './routes-routing.module';

// single pages
import { CallbackComponent } from './callback/callback.component';
import { Exception403Component } from './exception/403.component';
import { Exception404Component } from './exception/404.component';
import { Exception500Component } from './exception/500.component';
import { FileDownloadService } from '@abp/utils/file-download.service';
import { DashboardComponent } from './dashboard/dashboard.component';
import { MultipleUploadFileComponent } from './components/multiple-upload-file/multiple-upload-file.component';
import { UploadFileComponent } from './components/upload-file/upload-file.component';
import { EnumComboComponent } from './components/enum-combo/enum-combo.component';
import { EditionComboComponent } from './components/edition-combo/edition-combo.component';
import { RoleComboxComponent } from './components/role-combox/role-combox.component';
import { RoleComponent } from './roles/role.component';
import { RoleCreateOrEditComponent } from './roles/role-create-or-edit.component';
import { PermissionTreeComponent } from './components/permission-tree/permission-tree.component';
import { EditionComponent } from './editions/editions.component';
import { CreateOrEditEditionComponent } from './editions/create-or-edit-edition/create-or-edit-edition.component';
import { UsersComponent } from './users/users.component';
import { CreateOrEditUserComponent } from './users/create-or-edit-user/create-or-edit-user.component';
import { EditUserPermissionsComponent } from './users/edit-user-permissions/edit-user-permissions.component';
import { PaySettingComponent } from './paySettings/pay-settings.component';
import { SmsCodeSettingComponent } from './smsCodeSettings/sms-code-settings.component';
import { StorageSettingComponent } from './storageSettings/storage-settings.component';
import { MiniProgramSettingComponent } from './miniProgramSettings/mini-program-settings.component';
import { AudiLogComponent } from './auditLogs/audi-log.component';
import { AuditLogDetailComponent } from './auditLogs/audit-logs-detail/audit-log-detail.component';
import { MaintenanceComponent } from './maintenance/maintenance.component';
import { CloumnComponent } from './cloumns/cloumns.component';
import { CloumnParentComboComponent } from './components/cloumn-parent-combo/cloumn-parent-combo.component';
import { CreateOrEditCloumnComponent } from './cloumns/create-or-edit-cloumns/create-or-edit-cloumn.component';
import { ArticleSourceComponent } from './articleSource/article-source.component';
import { CreateOrEditArticleSourceComponent } from './articleSource/create-or-edit-article-source/create-or-edit-article-source.component';
import { ArticleSourceComboComponent } from './components/article-source-combo/article-source-combo.component';

import { ArticleComponent } from './articles/article.component';
import { CreateOrEditArticleComponent } from './articles/create-or-edit-article/create-or-edit-article.component';
import { EditorComponent } from './components/editor/editor.component';

const COMPONENTS = [
  DashboardComponent,
  RoleComponent,
  // single pages
  CallbackComponent,
  Exception403Component,
  Exception404Component,
  Exception500Component,
];
const COMPONENTS_NOROUNT = [
  RoleCreateOrEditComponent,
  CreateOrEditEditionComponent,
  CreateOrEditUserComponent,
  EditUserPermissionsComponent,
  AuditLogDetailComponent,
  MaintenanceComponent,
  CreateOrEditCloumnComponent,
  CreateOrEditArticleSourceComponent,
  CreateOrEditArticleComponent,
];

@NgModule({
  imports: [
    SharedModule,
    RouteRoutingModule,
    UEditorModule.forRoot({
      js: [
        `./assets/ueditor/ueditor.config.js`,
        `./assets/ueditor/ueditor.all.min.js`,
      ],
      // 默认前端配置项
      options: {
        UEDITOR_HOME_URL: './assets/ueditor/'
      }
    })
  ],
  declarations: [
    ...COMPONENTS,
    ...COMPONENTS_NOROUNT,
    //DashboardHeaderComponent
    UploadFileComponent,
    MultipleUploadFileComponent,
    PermissionTreeComponent,
    EditionComboComponent,
    RoleComboxComponent,
    EditionComponent,
    UsersComponent,
    AudiLogComponent,
    PaySettingComponent,
    SmsCodeSettingComponent,
    StorageSettingComponent,
    MiniProgramSettingComponent,
    CloumnComponent,
    CloumnParentComboComponent,
    EnumComboComponent,
    ArticleSourceComponent,
    ArticleSourceComboComponent,
    ArticleComponent,
    EditorComponent,
  ],
  providers: [FileDownloadService],
  entryComponents: COMPONENTS_NOROUNT,
})
export class RoutesModule { }
